// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

//import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:flutter_application_container/main.dart';

void main() {
  testWidgets('Container demo app smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const ContainerDemoApp());

    // Verify that the app starts and shows the expected content
    expect(find.text('Flutter容器功能演示'), findsOneWidget);
    expect(find.text('剪裁演示'), findsOneWidget);
    expect(find.text('变换演示'), findsOneWidget);
    expect(find.text('装饰盒演示'), findsOneWidget);
  });

  testWidgets('Tab switching test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const ContainerDemoApp());

    // Tap on the second tab (变换演示)
    await tester.tap(find.text('变换演示'));
    await tester.pumpAndSettle();

    // Verify we can see transform demo content
    expect(find.text('1. 基础矩阵变换(倾斜)'), findsOneWidget);

    // Tap on the third tab (装饰盒演示)
    await tester.tap(find.text('装饰盒演示'));
    await tester.pumpAndSettle();

    // Verify we can see decorated box demo content
    expect(find.text('登录'), findsOneWidget);
    expect(find.text('注册'), findsOneWidget);
  });

  testWidgets('Clip demo content test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const ContainerDemoApp());

    // Should be on the first tab (剪裁演示) by default
    expect(find.text('1. 基本剪裁组件'), findsOneWidget);
    expect(find.text('ClipOval - 圆形剪裁'), findsOneWidget);
    expect(find.text('ClipRRect - 圆角矩形剪裁(圆角20)'), findsOneWidget);
  });
}
